<?php 
class Staticpage_model extends model
{
	function __construct()
	{
		parent::__construct();	
	}
	
	function getresultpages()
	{
		$this->load->database();
		
        $query = $this->db->get('bur_staticpages');
        	
		return $query->result();
	}
	
	function getresultbyid($id)
	{
		$this->load->database();
		$query = $this->db->get_where('bur_staticpages',array('staticpage_id' => $id));
		return $query->result();	
	}
	
	function update()
	{
		$this->load->database();
		$arr = array(	
							'staticpage_title' => $this->input->post('title'),
						   'staticpage_subtitle' => $this->input->post('subtitle'),
						   'staticpage_content' => $this->input->post('content'),
                           'staticpage_content2' => $this->input->post('content2'),
						  	'staticpage_metakey' => $this->input->post('meta_keyword'),
						  	'staticpage_metadesc' => $this->input->post('meta_description')
				);	
				
		$this->db->where('staticpage_id', $this->input->post('staticpage_id'));
		$this->db->update('bur_staticpages', $arr);
		//echo $this->db->last_query();die();
		return TRUE;
	}
}	